/**
 * 
 */
package stc.skymobi.fsm.predicate;

import static org.junit.Assert.*;

import java.util.Arrays;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import xj.toolkit.fsm.predicate.TypeAcceptor;

/**
 * @author isdom
 *
 */
public class TypeAcceptorTestCase {

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link xj.toolkit.fsm.predicate.TypeAcceptor#evaluate(java.lang.Object)}.
	 */
	@Test
	public void testEvaluate() {
		TypeAcceptor acceptor = new TypeAcceptor();
		
		acceptor.setAllowTypes( 
				Arrays.asList( new Class<?>[]{ (BizIntf.class) } ) );
		
		assertTrue( acceptor.evaluate(new BizBean()) );
		
		assertFalse( acceptor.evaluate(new Object()) );
		
		assertFalse( acceptor.evaluate(new Integer(1)) );
	}

}
